import sys

def syracuse_nontail(n, n_orig=0):
	print "syracuse_nontail", [n, n_orig]
	if n_orig == 0:
		n_orig = n
	inc = 1 if n>n_orig else 0
	print n
	if n < 2:
		return inc
	elif n & 1: #odd
		nx = n*3 + 1
	else: #even
		nx = n/2
	return syracuse_nontail(nx, n_orig)+inc

def syracuse(n, n_orig=0, c=0):
	print "syra", [n, n_orig, c]
	if n_orig == 0:
		n_orig = n
	elif n > n_orig:
		c += 1
	print n
	if n < 2:
		return c
	elif n & 1: #odd
		nx = n*3 + 1
	else: #even
		nx = n/2
	return syracuse(nx, n_orig, c)

a = syracuse_nontail(int(sys.argv[1]))
#a = syracuse(int(sys.argv[1]))
print "answer", a
